package cn.yitun.chat.yitunserverimapicore.business.account.service.impl;

import cn.yitun.chat.yitunserverimapicore.business.account.service.AccountService;
import cn.yitun.chat.yitunserverimcore.general.main.biz.userchat.manager.UserManager;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 账号相关业务
 * Date 2019-01-20 12:35:32
 * Description
 * @author yitun
 * @version 1.1
 */
@Service
@Slf4j
public class AccountServiceImpl implements AccountService{

	@Resource
	private UserManager userManager;

	/**
	 * 账号是否存在
	 * @param userId
	 * @param account
	 * @return
	 */
	public boolean isExistAccount(Long userId, String account) {
		return userManager.isExistAccount(userId, account);
	}

	/**
	 * 邮箱是否存在
	 * @param userId
	 * @param email
	 * @return
	 */
	public boolean isExistEmail(Long userId, String email) {
		return userManager.isExistEmail(userId, email);
	}

	/**
	 * 手机号是否存在
	 * @param userId
	 * @param mobile
	 * @return
	 */
	public boolean isExistMobile(Long userId, String mobile) {
		return userManager.isExistMobile(userId, mobile);
	}
}
